package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.zr.dao.SelectDateDao;
import com.zr.model.Employee;
import com.zr.util.JDBCUtil;

public class SelectDateDaoImpl implements SelectDateDao{

	@Override
	public Employee selectDateByEid(int eid) {
		Employee emp = new Employee();
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT overtime.date ");
		sql.append(" from overtime ");
		sql.append(" WHERE overtime.eid = ? ");
		Connection con = JDBCUtil.getConnection();
		try {
			PreparedStatement pst = con.prepareStatement(sql.toString());
			pst.setInt(1, eid);
			ResultSet rs = pst.executeQuery();
			while(rs.next()){
			 emp.setDate(rs.getString("date"));
			 
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return emp;
		
		
	}

}
